package com.jun.pojo.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;

@Data
@AllArgsConstructor
public class R implements Serializable {
  private Integer code;
  private String msg;
  private Object result;

  public R() {
    this(200, "", null);
  }

  public R(Object data) {
    this(200, "", data);
  }

  public R(Integer code, String msg) {
    this(code, msg, null);
  }

  public R success() {
    return new R(200, "success");
  }

  public R error() {
    return new R(500, "error");
  }
}
